import React from 'react'
import { Button, Upload } from 'antd'
import { UploadRequestOption } from 'rc-upload/lib/interface'
import axios from 'axios'

const Index = () => {
	// const customRequest = (options: UploadRequestOption) => {
	// 	const file = options.file as File;

	// 	const formData = new FormData()

	// 	formData.append('file', file.slice(0, file.size), file.name);

	// 	axios.post('/api/uu', formData).then(resp => {
	// 		console.log(resp.data)
	// 	})

	// }
	return (
		<div>
			<Upload action="/api/oss/upload" method='post'>
				<Button>上传文件到阿里云</Button>
			</Upload>
			<img src="http://2005a-10.oss-cn-hangzhou.aliyuncs.com/2.webp" alt="" />
			<video style={{ width: 500 }} src="http://2005a-10.oss-cn-hangzhou.aliyuncs.com/20220621_094145.mp4" controls></video>
		</div>
	)
}

export default Index